package com.sumainfor.pc.market.controller;

import com.sumainfor.pc.market.service.TenantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author Meng
 * @ClassName TenantController
 * @date 2019/9/17 16:59
 * @description: TODO
 */
@RestController
@RequestMapping("/tenant/info")
public class TenantAndOwnerController {

    @Autowired
    private TenantService tenantService;

    /**
     * @Description //TODO 通过姓名或者手机号查询租客id
     * @return java.util.List<java.lang.String>
     * @Param [keyWord]
     * @Date 2019/9/17 17:03
     **/
    @GetMapping("/getTenantInfoByNameOrPhone")
    public List<String> getTenantInfoByNameOrPhone(@RequestParam("keyWord") String keyWord) {

        return tenantService.getTenantInfoByNameOrPhone(keyWord);
    }

    /**
     * @Description //TODO 通过合同编号查询租客id
     * @return java.util.List<java.lang.String>
     * @Param [keyWord]
     * @Date 2019/9/17 17:03
     **/
    @GetMapping("/getTenantInfoByPaId")
    public List<String> getTenantInfoByPaId(@RequestParam("keyWord") String keyWord) {

        return tenantService.getTenantInfoByPaId(keyWord);
    }

    /**
     * @Description //TODO 通过姓名或者手机号查询业主id
     * @return java.util.List<java.lang.String>
     * @Param [keyWord]
     * @Date 2019/9/17 17:03
     **/
    @GetMapping("/getOwnerIdByNameOrPhone")
    public List<String> getOwnerIdByNameOrPhone(@RequestParam("keyWord") String keyWord) {

        return tenantService.getOwnerIdByNameOrPhone(keyWord);
    }

    /**
     * @Description //TODO 通过合同编号查询业主id
     * @return java.util.List<java.lang.String>
     * @Param [keyWord]
     * @Date 2019/9/17 17:03
     **/
    @GetMapping("/getOwnerIdByPaId")
    public List<String> getOwnerIdByPaId(@RequestParam("keyWord") String keyWord) {

        return tenantService.getOwnerIdByPaId(keyWord);
    }
}
